﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.Text;
using System.ServiceModel.Web;

namespace ClusteringService
{

    // 注意: 如果更改此处的接口名称 "IService1"，也必须更新 Web.config 中对 "IService1" 的引用。
    [ServiceContract]
    public interface IService
    {
        //测试用的管理接口
        [OperationContract, WebGet]
        string ClearPeer();

        [OperationContract, WebGet]
        string Hello();

        [OperationContract, WebGet]
        List<string> DisplayAllPeers();

        //[OperationContract, WebGet]
        //ConfirmMessage GetConfirm();

        //客户端接口
        [OperationContract, WebGet(UriTemplate = "/GetServerState")]
        string GetServerState();

        //[OperationContract, WebGet(UriTemplate = "/Login")]
        //ClusteringKeyMessage Login();

        //[OperationContract, WebGet(UriTemplate = "/Logout?key={clustering_key}")]
        //ConfirmMessage Logout(string clustering_key);

        //[OperationContract, WebGet(UriTemplate = "/GetInstruction?key={clustering_key}")]
        //ClusteringInstructionMessage GetInstruction(string clustering_key);

        [OperationContract, WebGet(UriTemplate = "/QueryPeer?application={application_key}&peer={clustering_key}")]
        PeerClusterMessage QueryPeer(string application_key, string clustering_key);
    }
}
